package pine.web.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import pine.web.model.User;

@Repository("UserDao")
public class UserDaoImpl extends AbstractHibernateDao<User> implements UserDao {

	@Override
	protected Class<User> getEntityClass() {
		return User.class;
	}
	
	@Override
	public User loadUserByName(String username) {
		User user = new User();
		user.setUsername(username);
		List<User> list = findByExample(user);
		return list == null ? null : list.get(0);
	}
	
}
